package com.soap.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class FileXmlUtil {

	public static void main(String[] args) {
		System.out.println(FileXmlUtil.xmlToString());
	}
	
	public static String xmlToString(){
		File file = new File("F:\\xmtt.xml");
		StringBuffer xml = new StringBuffer();
		FileReader fr = null;
		int c = 0;
		try {
			fr = new FileReader(file);
			while ((c = fr.read()) != -1) {
				xml.append((char)c);
			}
			fr.close();
		} catch (FileNotFoundException e) {
			System.out.println("找不到指定文件");
		} catch (IOException e) {
			System.out.println("文件读取错误");
		}
		return xml.toString();
	}

}
